<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>考生信息</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            padding: 20px;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            background-color: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        h1 {
            text-align: center;
        }
        table {
            width: 100%;
            margin-bottom: 20px;
            border-collapse: collapse;
        }
        table, th, td {
            border: 1px solid #ddd;
        }
        th, td {
            padding: 8px 12px;
            text-align: left;
        }
        button {
            padding: 10px;
            background-color: #28a745;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        button:hover {
            background-color: #218838;
        }
        /* 新增 CSS，用于居中按钮 */
        .button-container {
            text-align: center;
            margin-top: 20px;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>考生信息</h1>

    <!-- 显示学生的基本信息 -->
    <table>
        <tr>
            <th>考生ID</th>
            <td>${student.id}</td>
        </tr>
        <tr>
            <th>考生报考的二级学科id</th>
            <td>${student.secondaryDisciplineId.substring(7, 13)}</td>
        </tr>
        <tr>
            <th>考生报考的二级学科名</th>
            <td>${disciplineName}</td>
        </tr>
        <tr>
            <th>是否接受调剂</th>
            <td>${student.isAdjustmentAccepted ? '是' : '否'}</td>
        </tr>

    </table>

    <!-- 显示该学生的所有科目成绩 -->
    <h2>成绩列表</h2>
    <table>
        <tr>
            <th>科目ID</th>
            <th>科目名称</th>
            <th>考试类型</th>
            <th>成绩</th>
        </tr>
        <c:forEach var="studentScore" items="${studentScores}">
            <tr>
                <td>${studentScore.examId}</td>
                <td>${studentScore.examName}</td>
                <td>${studentScore.examType}</td>
                <td>${studentScore.score}</td>
            </tr>
        </c:forEach>
    </table>

    <!-- 确认录取按钮 -->
    <!-- 确认录取按钮居中 -->
    <div class="button-container">
        <form action="confirmAdmission.jsp" method="post">
            <input type="hidden" name="studentId" value="${student.id}">
            <button type="submit">确认录取</button>
        </form>
    </div>

   <%-- <h2>调剂意愿</h2>
    <table>
        <tr>
            <th>报考二级学科id</th>
            <td>${student.secondaryDisciplineId}</td>
            <th>是否接受调剂</th>
            <td>
                <c:choose>
                    <c:when test="${student.isAdjustmentAccepted}">是</c:when>
                    <c:otherwise>否</c:otherwise>
                </c:choose>
            </td>

        </tr>
    </table>--%>
</div>
</body>
</html>
